<script type="text/javascript">
	$(function() {
		var id = $('#id').val();
		if (id == '1' || id == '2') {
			$('#start').removeAttr('disabled');
			$('#end').removeAttr('disabled');
		} else {
			$('#start').attr('disabled', 'disabled').val('');
			$('#end').attr('disabled', 'disabled').val('');
		}
		
		$('#id').click(function() {
			var id = $(this).val();
			if (id == '1' || id == '2') {
				$('#start').removeAttr('disabled');
				$('#end').removeAttr('disabled');
			} else {
				$('#start').attr('disabled', 'disabled').val('');
				$('#end').attr('disabled', 'disabled').val('');
			}
		});
	});
</script>

<div id="main-content" class="prepend-1 span-19 last">
	<h3>Generate Laporan Beasiswa</h3>
<?php echo form_open('mahalum/report/index', array('class' => 'form')); ?>
	<table>
		<tr>
			<td width="150px"><label>Kategori</label></td>
			<td>
				<select name="id" id="id">
					<option value="" <?php echo set_select('id', '', TRUE); ?>>--Silakan pilih kategori laporan--</option>
					<option value="1" <?php echo set_select('id', '1'); ?>>Laporan sejarah mahasiswa penerima beasiswa</option>
					<option value="2" <?php echo set_select('id', '2'); ?>>Laporan mahasiswa pendaftar beasiswa yang belum pernah diterima</option>
					<option value="3" <?php echo set_select('id', '3'); ?>>Daftar mahasiswa yang sedang mendaftar beasiswa</option>
				</select>
				<span class="error" id="idError"><?php echo form_error('id'); ?></span>
			</td>
		</tr>
		<tr>
			<td><label>Tahun Periode</label></td>
			<td>
				Mulai: <input maxlength="4" type="text" name="start" id="start" disabled="disabled" value="<?php echo set_value('start'); ?>" />
				<?php echo nbs(3); ?>
				Akhir: <input maxlength="4" type="text" name="end" id="end" disabled="disabled" value="<?php echo set_value('end'); ?>" />
				<span class="error" id="yearError"><?php echo form_error('end'); ?></span>
			</td>
		</tr>
	</table>
	<input type="submit" class="submit" name="submit" id="view" value="Lihat Laporan" />
	<?php echo nbs(3); ?>
	<input type="submit" class="submit" name="submit" id="export" value="Download Laporan" /> 
<?php echo form_close(); ?>
	<div class="clear"><?php echo nbs(); ?></div>
<?php if (!isset($id)) : ?>
</div>
<?php endif; ?>